package javalearn;

import java.io.FileNotFoundException;

public class Main {
    public static void main(String[] args) {
        Thread1 thread1 = new Thread1();
        Thread2 thread2 = new Thread2();
        thread1.setName("t1");
        thread2.setName("t2");

        thread1.start();
        thread2.start();

//        System.out.println(s.name);;
//        People p2 = new Teacher();
//        p2.sleep();

    }

    public static void add(String s) throws FileNotFoundException {
        if (!s.endsWith(".txt")){
            throw new FileNotFoundException("File not found");
        }
    }
    public static String concat(String... s) {
        StringBuilder str = new StringBuilder();
        for (String string : s) {
            str.append(string);
        }
        return str.toString();
    }

    public int mySqrt(int x) {
        int end = x;
        int begin = 1;
        int ans = 0;
        while (begin <= end) {
            int mid = (begin + end) / 2;
            if (mid <= x / mid) {
                begin = mid + 1;
                ans = mid;
            } else end = mid - 1;
        }
        return ans;
    }
}